Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added additional severity levels and ability to customize levels. #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bokysan
Copy link

@bokysan bokysan commented Dec 2, 2018

This commit:

  • Aligns the severity levels in loggo with syslog severity
    levels. This makes it easier to export logging through loggo
    directly to syslog.
  • Enables the user to customize / define custom severity levels.
    Some users like to define levels such as TRACE1, TRACE2 and
    TRACE3 for additional fine logging. This commit makes it possible
    to customize these levels on a per-project basis.

Backward compatibility notice: While there should be no issues
with backward compatibility and this should work completely out
of the box, please notice that, to align the code with syslog levels,
the values for the severity levels have been changed and now
lower values are considered more level.

Signed-off-by: Bojan Čekrlić [email protected]

This commit:
- Aligns the severity levels in loggo with syslog severity
  levels. This makes it easier to export logging through loggo
  directly to syslog.
- Enables the user to customize / define custom severity levels.
  Some users like to define levels such as TRACE1, TRACE2 and
  TRACE3 for additional fine logging. This commit makes it possible
  to customize these levels on a per-project basis.

**Backward compatibility notice:** While there should be no issues
with backward compatibility and this should work completely out
of the box, please notice that, to align the code with syslog levels,
the **values for the severity levels have been changed** and now
**lower values** are considered more level.

Signed-off-by: Bojan Čekrlić <[email protected]>
@jujubot
Copy link
Contributor

jujubot commented Dec 2, 2018

Can one of the admins verify this patch?

1 similar comment
@jujubot
Copy link
Contributor

jujubot commented Dec 2, 2018

Can one of the admins verify this patch?

@howbazaar
Copy link
Contributor

I'm not a fan of adding more severity levels, or changing the ordering. Ordering mainly because we make use of this knowledge elsewhere.

Have you considered just working with a syslog writer? One that just does the value conversions when writing to syslog? I have vague recollections of one being written already.

@howbazaar
Copy link
Contributor

For example, found this one: github.com/wolfeidau/loggo-syslog

@bokysan
Copy link
Author

bokysan commented Jan 14, 2019

Hi,

https://github.com/wolfeidau/loggo-syslog will write to syslog, however, it will not support all logging levels offered by Syslog, because juju/loggo does not support them.

What this patch does is:

I was a bit undecided, if ordering should be changed or not. In the end decided to go for it -- mostly because it makes more sense that the maximum level (EMERGENCY) is bound to a boundary. Another option would be to keep it as is and then have negative logging levels for new custom levels, which I think is a worse solution.

I have also verified where the log level code comparisons are used and all tests pass with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants